import Vue from 'vue'
import Router from 'vue-router'
import layOut from '@/views/layOut'
import news from '@/views/news/news'
import newsCreate from '@/views/news/newsCreate'
import video from '@/views/video/video'
import videoCreate from '@/views/video/videoCreate'
import goods from '@/views/goodsCenter/goods'
import login from '@/views/login/login';
import accountList from '@/views/account/List';

Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'/',
      redirect:'/user/login'
    },
    {
      path: '/home',
      name: 'layOut',
      component: layOut,
      children:[{
        path: '/news/grid',
        name: 'news',
        component: news
      },{
        path: '/account/grid',
        name: 'account',
        component: accountList
      },{
        path: '/news/grid/create',
        name: 'newsCreate',
        component: newsCreate
      },{
        path: '/news/grid/update/:id',
        name: 'newsCreate',
        component: newsCreate
      },{
        path:'/video/grid',
        name:'video',
        component:video
      },{
        path:'/video/grid/create',
        name:'videoCreate',
        component:videoCreate
      },{
        path: '/video/grid/update/:id',
        name: 'videoCreate',
        component: videoCreate
      },{
        path: '/goods/grid',
        name: 'goods',
        component: goods
      }],
      redirect:'/news/grid'
    },
    {
      path:'/user/login',
      name:'login',
      component:login
    }
  ]
})
